package top.mable.springannotation;

import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author taffywen
 * @date 2022/4/8 22:37
 */


@Configuration
@EnableConfigurationProperties
public class MyConditional {

    @ConditionalOnBean(name = "pet")
    @Bean
    public AutoServiceRegistrationAutoConfiguration autoServiceRegistrationAutoConfiguration(){
        return new AutoServiceRegistrationAutoConfiguration();
    }
}
